package 每日一题;

import java.util.Scanner;

public class WY18统计回文 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String str1=sc.nextLine();
        String str2=sc.nextLine();

        int count=0;
        for (int i = 0; i <=str1.length(); i++) {
            StringBuilder sb=new StringBuilder(str1);
            sb.insert(i,str2);

            StringBuilder tmp=new StringBuilder(sb);
            if (tmp.reverse().toString().equals(sb.toString())) {
                count++;
            }
        }
        System.out.println(count);
    }

    public static void main1(String[] args) {
        Scanner sc=new Scanner(System.in);
        String str1=sc.nextLine();
        String str2=sc.nextLine();

        int count=0;
        for (int i = 0; i <=str1.length(); i++) {
            StringBuilder sb=new StringBuilder(str1);
            sb.insert(i,str2);
            if (isfun(sb.toString())) {
                //是回文串，则count++
                count++;
            }
        }
        System.out.println(count);
    }

    private static boolean isfun(String string) {
        int left=0;
        int right=string.length()-1;
        while (left<right) {
            if (string.charAt(left)!=string.charAt(right)) {
                return false;
            }
            left++;
            right--;
        }
        return true;
    }
}
